#import <Foundation/Foundation.h>
#import "SynthesizeSingleton.h"
#import "TopicDetailModel.h"
#import "TopicManager.h"

@interface CoreDataManager : NSObject<NSFetchedResultsControllerDelegate> {
    NSString *fileName;
    NSString *entityName;
    NSString *imgPath;
    NSString *corePath;
}

SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER(CoreDataManager);

@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (void)saveContext;
- (void)coredataInsert:(TopicDetailModel *)topicDetail;//插入
- (BOOL)coredataTopicDetailUpdate:(TopicDetailModel *)topicDetail; //更新
- (BOOL)coredataTopicDetailSelect:(TopicDetailModel *)topicDetail; //查询
- (void)deleteAllTopicDetailForCoredata:(NSString *)sort :(NSMutableArray *)topicIds; //删除
- (void)coredataTopicDetailPathDictUpdate;
@end
